<?php
if (isset($_GET['code'])){
    //echo $_GET['code'];
    //header("Location:"."https://api.weixin.qq.com/sns/oauth2/access_token?appid=wxdb57e2621068fc01&secret=d4624c36b6795d1d99dcf0547af5443d&code=$_GET[code]&grant_type=authorization_code");
    $url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wxdb57e2621068fc01&secret=d4624c36b6795d1d99dcf0547af5443d&code=$_GET[code]&grant_type=authorization_code";
    $contents = file_get_contents($url);
    echo $contents;
    print_r(json_decode($contents));
}else{
    echo "NO CODE";
}
?>